/**
 * Created by lenovo on 2017/11/16.
 */
var QUERYBYID_URL="http://localhost:8080/card/querybyid/";
$(function () {
    var userno=$.cookie("userno");
    $.ajax({
        url:QUERYBYID_URL+userno,//+role
        type:"post",
        dataType:"json",
        statusCode:{
            200:function (data) {
                $(data).each(function (index) {
                    var id=$("#list>tbody>tr:last").attr("id");
                    id++;
                    var str="<tr id='"+id+"' height='40' bgcolor='#FFFF88'>"+
                        "<td align='center' valign='middle' class='borderright borderbottom'>"+data.userno+"</td>"+
                        "<td align='center' valign='middle' class='borderright borderbottom'>"+data.username+"</td>"+
                        "<td align='center' valign='middle' class='borderright borderbottom'>"+data.sex+"</td>"+
                        "<td align='center' valign='middle' class='borderright borderbottom'>"+data.college+"</td>"+
                        "<td align='center' valign='middle' class='borderright borderbottom'>"+data.classes+"</td>"+
                        "<td align='center' valign='middle' class='borderright borderbottom'>"+data.balance+"</td>"+
                        "<td align='center' valign='middle' class='borderright borderbottom'>"+data.datetime+"</td>"+
                        "<td align='center' valign='middle' class='borderright borderbottom'>"+data.state+"</td>"+
                        "</tr>";
                    $("#list").append(str);
                })
            }
        }
    })
});